<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>申请表填写</title>
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet" />
    <script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

    <style>

        .back{
            width:1250px;
            height: 1000px;
            padding-top: 30px ;
        }
        .studentcss{
            width:1250px;
            height: 200px;
            floa:left;
        }
        table{
            margin-top:10px;
            margin-left: 100px;
        }
        table th{
            width:180px;
            font-weight: 100;
            margin-left: 30px;
        }
        table td{
            text-align: center;
            width:250px;
            height: 50px;
            margin-left: 30px;
        }
        .familycss{
            width:1350px;
            height: 300px;
            floa:left;
        }
        .familycss table{
            margin-top:10px;
            margin-right: 100px;
        }
        .familycss table th{
            width:150px;

            margin-left: 15px;
        }
        .familycss table td{
            text-align: center;
            width:250px;
            height: 50px;
            margin-left: 30px;
        }
        .applycss{

            width:1250px;
            height: 320px;
            floa:left;
        }
        .submit{
            width:1250px;
            height: 50px;
            floa:left;
        }
        input{
            padding-right: 10px;
            margin-top: 10px;
            width: 160px;
            height: 30px;
            border-radius: 5px;
            border: 1px solid #4169E1;
            text-align: center;
        }
        input disabled{
            padding-right: 10px;
            margin-top: 10px;
            width: 160px;
            height: 30px;
            border-radius: 5px;
            border: 1px solid #4169E1;
            text-align: center;
            background-color: #4169E1;
        }
        select{
            padding-right: 10px;
            margin-top: 10px;
            width: 160px;
            height: 30px;
            border-radius: 5px;
            border: 1px solid #4169E1;
            text-align: center;
        }
        h3{
            color: #00c0ef;
            font-weight: 900;
            margin-left: 130px;
        }
        .hengxian{
            margin-left: 100px;
            width: 1150px;
            height: 3px;
            border-top: solid rgb(0,0,0) 1px;
            background-color: #00b4ef;
        }
        .submitButton{
            margin-left: 1085px;
            width: 120px;
            height: 45px;
            border-radius: 5px;
            color: white;
            background-color: #47caf1;

        }
        input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; }
        input[type="number"]{ -moz-appearance: textfield; }
        .baseMessage3{
            font-weight:600;
            width:180px;
            height:50px;
            font-size: 14px;
            float: left;
            margin-left: 10px;
            padding-left: 10px;
        }
        .baseMessage3 span{
            font-weight:500;
        }
        input:disabled{
            border: 0px ;
            background-color:white;

            text-align: center;
            width: 150px;
        }
        .baseMessage2 span{
            font-weight:500;
        }
        .baseMessage2 p{

            font-size: 16px;
        }
        .baseMessage  p{
            text-align: center;

            font-size: 28px;
        }
    </style>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div th:replace="~{commons/header::header}"></div>
    <!-- left -->
    <div th:replace="~{commons/studentLeft::left}"></div>
    <!-- 内容主体区域 -->
    <div class="layui-body">
        <div class="back" ><h1 style="text-align: center">勤工俭学申请表</h1>
            <form action="/hw_stu_writeApply" method="get" name="myForm" onsubmit="return validateForm();" autocomplete="off">
                <div class="submit">
                    <input type="submit" value="提交" class="submitButton">
                </div>
                <h3 >一、个人信息</h3>
                <div class="hengxian"></div>
                <div class="studentcss">
                    <table>

                        <tr th:each="studentList:${studentList}">
                            <td>姓名:</td>
                            <th ><input disabled=“disabled”   th:value="${studentList.getStuName()}" ></th>
                            <td>学号:</td>
                            <th ><input disabled=“disabled”  th:value="${studentList.getStuId()}" ></th>
                            <td>性别:</td>
                            <th ><input disabled=“disabled”  th:value="${studentList.getStuSex()}" ></th>
                            <td>政治面貌:</td>
                            <th ><input disabled=“disabled”  th:value="${studentList.getStuPoliticalOutlook()}" ></th>
                        </tr>

                        <tr th:each="studentList:${studentList}">
                            <td>院系 :</td>
                            <th ><input disabled=“disabled”  th:value="${studentList.getStuCollege()}" ></th>
                            <td>年级:</td>
                            <th ><input disabled=“disabled”  th:value="${studentList.getStuMajor()}" ></th>
                            <td>班级:</td>
                            <th ><input disabled=“disabled”  th:value="${studentList.getStuGrade()}" ></th>
                            <td>专业:</td>
                            <th ><input disabled=“disabled”  th:value="${studentList.getStuClass()}" ></th>
                        </tr>

                        <tr th:each="studentList:${studentList}">
                            <td>联系方式:</td>
                            <th ><input disabled=“disabled”  th:value="${studentList.getStuPhone()}" ></th>
                            <td>辅导员姓名:</td>
                            <th ><input disabled=“disabled”  th:value="${studentList.getStuInstructor()}" ></th>
                            <td>身份证号:</td>
                            <th ><input disabled=“disabled”  th:value="${studentList.getStuIdCard()}" ></th>
                            <td>宿舍:</td>
                            <th ><input disabled=“disabled”  th:value="${studentList.getStuDormitory()}" ></th>
                        </tr>
                        <tr th:each="studentList:${studentList}">

                            <td>是否为贫困生:</td>
                            <th ><input disabled=“disabled”  th:value="${studentList.getStuIsPoor()}" >
                                <input type="hidden"  name="isPoor" th:value="${studentList.getStuIsPoor()}" ></th>
                            <td>资助等级:</td>
                            <th ><input disabled=“disabled”  th:value="${studentList.getStuAssistanceLevel()}" ></th>
                        </tr>
                    </table>
                    </div>
                <h3 >二、银行信息</h3>
                <div class="hengxian"></div>   <br>
                <table>

                    <tr th:each="studentList:${studentList}">
                        <td>所属银行:</td>


                        <td class="td2"><select name="province" >

                            <option value="中国工商银行" >中国工商银行</option>
                            <option value="中国建设银行">中国建设银行</option>
                            <option value="交通银行">交通银行</option>

                        </select></td>
                        <td>开户行:</td>
                        <td class="td2"> <select name="citys">
                            <option>请选择开户行</option>
                            <option  value="福州闽都支行">福州闽都支行</option>
                            <option   value="福建自贸试验区福州片区分行">中国建设银行</option>
                            <option   value="福州奥体支行">福州奥体支行</option>
                        </select></td>
                        <td>银行卡号:</td>
                        <th ><input  type="number" name="bankId" th:value="${studentList.getStuBankId()}" ></th>

                    </tr>
                </table>
                <br>
                <h3 >三、申请信息</h3>
                <div class="hengxian"></div>
                <div class="applycss">
                    <table>
                        <tr>
                            <td>用工批次:</td>
                            <th>
                                <select  name="batchTime">
                                    <option  th:each="team:${team}"
                                             th:text="${team.getBatchTeam}"></option>
                                </select>
                            </th>
                            <td>是否领取国家助学金:</td>
                            <th>
                                <select name="award">
                                    <option value="是">是</option>
                                    <option value="否">否</option>
                                </select>
                            </th>
                            <td>是否申请生源地助学贷款:</td>
                            <th>
                                <select name="orn">
                                    <option value="是">是</option>
                                    <option value="否">否</option>
                                </select>
                            </th>

                        </tr>
                        <tr>
                            <td>申请工作岗位:</td>
                            <th>
                                <select name="unit">
                                    <option value="学工处">学工处</option>
                                    <option value="图书馆">图书馆</option>
                                    <option value="财务部">财务部</option>
                                    <option value="心理咨询中心">心理咨询中心</option>
                                    <option value="创四方园">创四方园</option>
                                </select>
                            </th>
                            <td>曾工作岗位:</td>
                            <th>
                                <select name="pastUnit">
                                    <option value="无">无</option>
                                    <option value="学工处">学工处</option>
                                    <option value="图书馆">图书馆</option>
                                    <option value="财务部">财务部</option>
                                    <option value="心理咨询中心">心理咨询中心</option>
                                    <option value="创四方园">创四方园</option>
                                </select>
                            </th>
                            <td>尚欠学费:</td>
                            <th><input type="number" name="debt"></th>
                        </tr>
                        <tr>
                            <td>月生活费:</td>
                            <th><input type="number" name="monthMoney"></th>
                            <td>可工作时间:</td>
                            <th><input type="text" name="canworkTime" placeholder="如：每周四、周五下午"></th>
                        </tr>
                        <tr>
                            <td>在校表现情况:</td>
                            <th colspan="5" style="text-align: left;">
                                <input type="text" name="perform" style="text-align: left;width:1040px;height:50px;">
                            </th>
                        </tr>
                        <tr>
                            <td>家庭经济情况:</td>
                            <th  style="text-align: left;" colspan="5" >
                                <input type="text" name="familyLevelExplain" style="text-align: left;width:1040px;height:50px;"></th>

                        </tr>
                    </table>
                </div>
            </form>
            <h3 >四、家庭信息</h3>
            <div class="hengxian"></div>
            <div class="familycss">

                <table>
                    <thead>
                    <tr>
                        <th>称呼</th>
                        <th>姓名</th>
                        <th>工作单位</th>
                        <th>职业</th>
                        <th>月收入</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="familyList:${familyList}">
                        <form action="/stuApply_family_update" method="post" autocomplete="off">
                            <input type="hidden" name="familyNum" th:value="${familyList.getFamilyNum()}">
                            <td><input type="text"  name="familyRelation" th:value="${familyList.getFamilyRelation()}"></td>
                            <td><input type="text" name="familyName" th:value="${familyList.getFamilyName()}"></td>
                            <td><input type="text" name="familyWorkAddress" th:value="${familyList.getFamilyWorkAddress()}"></td>
                            <td><input type="text" name="familyWorkType" th:value="${familyList.getFamilyWorkType()}"></td>
                            <td> <input type="number"  name="familyIncome" th:value="${familyList.getFamilyIncome()}"></td>
                            <td>
                                <input type="submit" value="编辑" id="updateFamily" style="width:35px;height:30px;border-radius: 5px;color:white;background-color:#4169E1;margin-left:5px;">
                                </a>

                                <a th:href="@{'/stuApply_family_delete/'+${familyList.getFamilyNum()}}" ><input type="button" value="删除" th:onclick="return del()"
                                                                                                                style="width:35px;height:30px;border-radius: 5px;color:white;background-color:red;margin-left:5px;"></a>
                            </td>
                        </form>
                    </tr>
                    <tr>
                        <form action="/stuApply_family_add" method="post" onsubmit="return addFamily()" name="familyForm" autocomplete="off">
                            <td><input type="text" name="familyRelation2"></td>
                            <td><input type="text" name="familyName2"></td>
                            <td><input type="text" name="familyWorkAddress2"></td>
                            <td><input type="text" name="familyWorkType2"></td>
                            <td><input type="number" name="familyIncome2"></td>
                            <td><input type="submit" value="添加" name="submit"   style="width:65px;height:30px;border-radius:
                            5px;color:white;background-color:greenyellow;margin-left:5px;" ></td>
                        </form>>
                    </tr>
                    </tbody>
                </table>
            </div>
            </div>

        </div>

    </div>
</div>

<script th:src="@{/layui/layui.js}"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function() {
        var element = layui.element;
    });
    function validateForm() {
        var isPoor = document.forms["myForm"]["isPoor"].value;
        var bankId = document.forms["myForm"]["bankId"].value;
        var debt = document.forms["myForm"]["debt"].value;
        var monthMoney = document.forms["myForm"]["monthMoney"].value;
        var perform = document.forms["myForm"]["perform"].value;
        var canworkTime = document.forms["myForm"]["canworkTime"].value;
        var familyLevelExplain=document.forms["myForm"]["familyLevelExplain"].value;

        if(isPoor=="否"){
            alert("您不是贫困生，无法提交申请");
            return false;
        }else if(bankId.length!=18){
            alert("银行卡的位数为18位")
        }
        else if (  debt.length == 0 || monthMoney.length == 0 || perform.length == 0
            || canworkTime.length == 0||familyLevelExplain.length==0) {
            alert("输入不能为空");
            return false;
        }
        /*else if( "$(msg1)"!="success" ){
            alert("该人数已满");
            return false;
        }else if("$(msg1)"=="success"){
            alert("提交成功");
            return true;
        }*/else{
            alert("提交成功");
            return true;
        }

    }
    function del(){
        if(!confirm("确认要删除？")){
            window.event.returnValue = false;
        }
    }
    function addFamily(){
        var familyRelation2=document.forms["familyForm"]["familyRelation2"].value;
        var familyName2=document.forms["familyForm"]["familyName2"].value;
        var familyWorkAddress2=document.forms["familyForm"]["familyWorkAddress2"].value;
        var familyWorkType2=document.forms["familyForm"]["familyWorkType2"].value;
        var familyIncome2=document.forms["familyForm"]["familyIncome2"].value;


        if(familyRelation2.length==0||familyName2.length==0||familyWorkAddress2.length==0||familyWorkType2.length==0
            ||familyIncome2.length==0){
            alert("输入不能为空");
            return false;
        }
        else if("${msg}"!="" && "${msg}"!="success" ){
            alert("该数据已存在");
            return false;
        }else{
            alert("提交成功");
            return true;
        }
    }

</script>
</body>
</html>
